import ajax from './ajax'


//模板
//   reqShops = ({latitude, longitude}) => ajax('/api/shops', {latitude, longitude})   get请求传入多个参数
//   reqAddress = geohash => ajax('/api/position/' + geohash) 后台请求  /position/{geohash}
//   reqSendCode = phone => ajax('/api/sendcode', {phone})   get 请求传入一个参数
//   reqCategorys = () => ajax('/api/index_category')    get请求 不传入参数
//   reqSmsLogin = (phone, code) => ajax('/api/login_sms', {phone, code}, 'POST')   post请求 传入多个参数


//登录
export const reqLogin = (userName, secretkey) => ajax('/api/login', { userName, secretkey}, 'POST')
//获取验证码
export const reqGetCode = (phoneNo,scope) => ajax('/api/getCode', { phoneNo,scope}, 'POST')

//修改密码
export const reqForget = (phoneNo,Code,newPwd) => ajax('/api/teacher/getpassword', { phoneNo, Code,newPwd}, 'POST')


//获取任教班级
export const reqTeacherClass = () => ajax('/api/classgrade/view/')
//根据班级ID获取学生
export const reqStudent = (classId) => ajax('/api/Students/'+ classId)



//获取考试列表
export const reqExamList = (gradeId) => ajax('/api/exam/'+ gradeId)

//获取考试科目
export const reqExamSubject = (examId) => ajax('/api/examsub/'+ examId)
//获取总成绩
export const reqScore = (examId,classId,studentName) => ajax('/api/score',{examId,classId,studentName},'POST')
//获取科目成绩
export const reqSubjectScore = (examId,classId,subjectId,studentName) => ajax('/api/subject/score',{examId,classId,subjectId,studentName},'POST')
//获取学生成绩详情
export const reqStudentScore = (examId,studentId) => ajax('/api/parent/getScore',{examId,studentId},'POST')
//学生成绩分析
export const reqStudentAnalyze = (studentId,gradeId) => ajax('/api/student/score',{studentId,gradeId},'POST')
//班级成绩分析
export const reqClassAnalyze = (bExamId,eExamId,id,gradeId,judge) => ajax('/api/exam/analyze',{bExamId,eExamId,id,gradeId,judge},'POST')


//获取学校通知
export const  reqNoticeSchool = (noticeId) => ajax('/api/notice/school',{noticeId},'POST')
//获取班级通知
export const  reqNoticeClass = (classId,noticeId) => ajax('/api/notice/class',{classId,noticeId},'POST')
//获取缴费通知
export const  reqNoticePay = (classId,noticeId) => ajax('/api/notice/pay',{classId,noticeId},'POST')


//获取请假列表
export const  reqLeave = (leaveId) => ajax('/api/leave',{leaveId},'POST')
//回复请假消息
export const  reqSetLeave = (leaveId,remarks) => ajax('/api/setleave',{leaveId,remarks},'POST')


//作业列表
export const  reqTask = (className,taskId) => ajax('/api/taskview',{className,taskId},'POST')
//查看任教科目
export const reqSubject = () => ajax('/api/getSubject')
//上传图片
export const  reqUpLoadImg = (className,taskId) => ajax('/api/taskview',{className,taskId},'POST')
//发布作业


//通讯录
export const  reqBook = (classId) => ajax('/api/teacher/book',{classId},'POST')

//班级课表
export const  reqClasstimetable = (classId) => ajax('/api/parent/course/'+classId)
//教师课表
export const  reqTeachertimetable = (classId) => ajax('/api/teacher/course')
